<?xml version='1.0' encoding='UTF-8' ?>  
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">    
<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"  
    xmlns:ui="http://java.sun.com/jsf/facelets"  
    xmlns:h="http://java.sun.com/jsf/html"  
    template="./template_default.xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
    >  

    <f:metadata>
        <f:viewParam name="idUserAcheteur" value="#{managementBean.idUserAcheteur}"/>
    </f:metadata>
    
    <ui:define name="complementTitreEtH1">
        Liste d'articles de votre panier 
    </ui:define>  

    <ui:define name="content">  

        <p:dataTable value="#{managementBean.listeArticlePanierAcheteur}" var="item" emptyMessage="Vous n'avez pas encore de panier" paginator="true" rows="10" rendered="#{managementBean.connectedUser}">

            <p:column headerText="actions" width="40px">  
                <h:commandLink action="#{managementBean.supprimerArticlePanierAcheteur(item)}" >  
                    <h:graphicImage value="ressources/delete.png" alt="logoDelete" border="0" class="imgDelete"/>  
                </h:commandLink> 
                &nbsp;
            </p:column>

            <p:column sortBy="#{item.nom}" filterBy="#{item.nom}" filterMatchMode="contains">
                <f:facet name="header">
                    <h:outputText value="nom"/>
                </f:facet>
                <h:outputText value="#{item.nom}"/>
            </p:column>

            <p:column sortBy="#{item.prix}" width="40px">
                <f:facet name="header">
                    <h:outputText value="Type"/>
                </f:facet>
                <h:outputText value="#{item.prix}"/>
            </p:column>
            
            <p:column sortBy="#{item.urlImg}" width="80px">
                <f:facet name="header">
                    <h:outputText value="Image"/>
                </f:facet>
                 <h:graphicImage value="#{item.urlImg}" alt="logoDelete" border="0" class="imgArticles"/>  
            </p:column>


        </p:dataTable>
        
        <center><h:commandButton action="#{managementBean.enregistrerPanier()}" value="Enregistrer le panier dans la base" rendered="#{managementBean.connectedUser}"/></center>



    </ui:define>  

</ui:composition>  







